import sys
import traceback

def sys_exit(err_msg='', e_code=1, throw_it=False, exception_obj=RuntimeError):
    err_msg = f'👻->{err_msg}(抛出异常: {throw_it}→{bool(throw_it)})'
    if err_msg:
        print(err_msg)
    if throw_it:
        raise exception_obj(err_msg)
    else:
        traceback.print_stack()
        sys.exit(e_code)

